<?php

defined("_ARKN_EXEC") or exit("no no, mr. superman no here");

$username = $_POST["username"];
$password = $_POST["password"];

if(strlen($username) > 20)
	$username = substr($username, 0, 20);
if(strlen($password) > 20)
	$password = substr($password, 0, 20);

require_once "Authenticator.php";
if($authenticator->login($username, $password)) {
	$_SESSION["auth"] = 1;
	header("Location: " . ROOT_ADDRESS . "?page=home");
} else
	header("Location: " . ROOT_ADDRESS . "/invalid_credentials.php");

?>
